package com.sinosoft.zzz.controller;

import com.sinosoft.framework.annotation.*;
import com.sinosoft.zzz.service.UserService;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;


@Controller
@RequestMapping("/userController")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("/getUserName")
    public String getUserName(@RequestParam(value = "name",required = true) String userName, HttpServletResponse resp){
        System.out.println("userName is :" + userName);
        String uName = userService.getUserName(userName);
        try {
            resp.getWriter().write(uName);
        }catch (IOException e){
            e.printStackTrace();
        }
        return "";
    }
}
